<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>权限设置</title>
<link href="/css/role.css" rel="stylesheet" type="text/css" />
<link href="/css/lay.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- title -->
<div class="right_title">
<div class="h"><span>系统模块-</span><a href="/role/menu_manager.shtml">菜单管理</a>  <span><a href="/role/role_manager.shtml">角色设置</a></span>  <span><a href="/role/role_menu.shtml">角色菜单</a></span> <span><a href="/role/auth_manager.shtml">权限管理</a></span>  <span><a href="/role/role_auth.shtml">角色权限</a></span> </div>
</div>

<div class="zdgl xz_pad" style="border:0px solid red; padding-top: 0px;">
 <div class="subd" style="font-size:14px;font-weight:bold;margin:20px 0;"><input type="button" onclick="FW.op({height:430,url:'/role/to_auth.shtml',title:'添加权限'})" value="添加主权限"  style="width:80px;"/></div>
  
  <div class="d_01">
     
  
    <c:forEach items="${clist}" var="c">
        <div>
        <h3 style="margin:0;clear:both;"><span class="shi" onclick="cg('${c.id}_div',this)">&nbsp;&nbsp;</span>${c.authName} <a href="javascript:void(0);" onclick="FW.op({height:430,url:'/role/to_auth.shtml?id=${c.id}',title:'编辑权限'})"   style="width:80px;font-weight:normal;font-size:12px;">编辑</a> <a href="javascript:void(0);" onclick="FW.op({height:430,url:'/role/to_auth.shtml?pid=${c.id}',title:'添加权限'})" style="width:80px;font-weight:normal;font-size:12px;">添加子权限</a> <span style="color:#ff6666;font-weight:normal;font-size:12px;">${c.authRegexp}</span></h3>
        <dl style="padding-left:0px;display:none;" id="${c.id}_div">
	        <c:forEach items="${c.list}" var="m">
	                <dt style="margin:0;clear:both;padding:0;"><span class="yi">&nbsp;&nbsp;</span><span class="shi" onclick="bcg('dd',${m.id},this)">&nbsp;&nbsp;</span>${m.authName} <span style="color:#ff6666;">${m.authRegexp}</span>
	                &nbsp;<a href="javascript:void(0);" onclick="FW.op({height:430,url:'/role/to_auth.shtml?id=${m.id}',title:'编辑权限'})"   style="width:80px;">编辑</a>
	                &nbsp;</dt>
	                
	               
	                
	        </c:forEach>
	        
        </dl>
        </div>
    </c:forEach>
  </div>
  
  <div class="clear0"></div>
</div>
<!-- table end -->


</body>
</html>
<script type="text/javascript" src="/scripts/util.js"></script>
<script type="text/javascript" src="/scripts/xhr.js"/></script>
<script type="text/javascript" src="/scripts/lay.js"/></script>
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" >
   function cg(id,th){
     var o = util.$(id);
     if(o){
       o.style.display=o.style.display=='none'?'':'none';
       th.className=o.style.display=='none'?'shi':'shiyi';
     }
   }
   function bcg(tag,id,th){
      var r = document.getElementsByTagName(tag);
      var nr = filterpid(r,id);
      util.each(nr,function(e,i){
         e.style.display=e.style.display=='none'?'':'none';
         (i==0)&&(th.className==e.style.display=='none'?'shi':'shiyi');
      })
   }
   function filterpid(r,id){
      var nr=[];
      util.each(r,function(e){
         if(e.getAttribute('parent')==id){
            nr.push(e);
         }
      });
      return nr;
   }
  function ca(id,th){
     var r = filterCk(document.getElementsByName("ids"),id);
     util.each(r,function(e){
       e.checked=th.checked;
     });
  }
  function ac(id){
    var r = filterCk(document.getElementsByName("ids"),id);
    var b = false;
    util.each(r,function(e){
        if(e.checked){
          b=true;
          return 1;
        }
    });
    var t = util.$(id+'_ck');
    t&&(t.checked=b);
  }
  function filterCk(list,id){
    var r=[];
    util.each(list,function(e){
      (e.getAttribute('pid')==id)&&r.push(e);
    });
    return r;
  }
  function ck_check(){
      
  }
</script>


